package org.java.srb.core.service.impl;

import org.java.srb.common.exception.BusinessException;
import org.java.srb.core.pojo.entity.IntegralGrade;
import org.java.srb.core.mapper.IntegralGradeMapper;
import org.java.srb.core.service.IntegralGradeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 积分等级表 服务实现类
 * </p>
 *
 * @author huxb
 * @since 2021-04-11
 */
@Service
public class IntegralGradeServiceImpl extends ServiceImpl<IntegralGradeMapper, IntegralGrade> implements IntegralGradeService {


    @Resource
    private IntegralGradeMapper integralGradeMapper;

    @Override
    public void deleteById(String id) {
        IntegralGrade integralGrade = this.baseMapper.selectById(id);
        if (integralGrade == null) {
            throw new BusinessException("当前记录不存在或者已被删除！");
        }
        integralGradeMapper.deleteById(id);
    }
}
